//
//  XMNetwork+publish.m
//  XMJJ_zml
//
//  Created by 丁浩 on 2025/6/7.
//

#import "XMNetwork+publish.h"

@implementation XMNetwork (publish)

/**
 发布见面
 */
- (void)publishMeetingWithParameters:(NSMutableDictionary *)parameters
                             success:(void (^)(id _Nonnull))successBlock
                             failure:(void (^)(NSError * _Nonnull))failureBlock {
    [self postDataWithPath:publishMeetingUrl
                parameters:parameters
                 needToken:YES
                   headers:@{}
                   success:^(id  _Nonnull responseObject) {
        successBlock (responseObject);
    } failure:^(NSError * _Nonnull error) {
        failureBlock (error);
    }];
}

/**
 发布见面场景
 */
- (void)getMeetingSceneSuccess:(void (^)(id _Nonnull))successBlock
                       failure:(void (^)(NSError * _Nonnull))failureBlock {
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [self getDataWithPath:getServiceTypeUrl
               parameters:parameters
                needToken:YES
                  headers:@{}
                  success:^(id  _Nonnull responseObject) {
        successBlock (responseObject);
    } failure:^(NSError * _Nonnull error) {
        failureBlock (error);
    }];
}

/**
 推荐话题
 */
- (void)getRecommendTopicWithContent:(NSString *)contentStr
                             success:(void (^)(id _Nonnull))successBlock
                             failure:(void (^)(NSError * _Nonnull))failureBlock {
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters safe_setObject:contentStr forKey:@""];
    [self getDataWithPath:getRecommendTopicUrl
               parameters:parameters
                needToken:YES
                  headers:@{}
          showPrograssHUD:NO
                  success:^(id  _Nonnull responseObject) {
        successBlock (responseObject);
    } failure:^(NSError * _Nonnull error) {
        failureBlock (error);
    }];
}

/**
 见面详情
 */
- (void)getMeetingDetailWithServiceId:(NSString *)serviceId
                              success:(void (^)(id _Nonnull))successBlock
                              failure:(void (^)(NSError * _Nonnull))failureBlock {
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters safe_setObject:serviceId forKey:@"serviceId"];
    [self getDataWithPath:getMeetingDetailUrl
               parameters:parameters
                needToken:YES
                  headers:@{}
                  success:^(id  _Nonnull responseObject) {
        successBlock (responseObject);
    } failure:^(NSError * _Nonnull error) {
        failureBlock (error);
    }];
}

/**
 上传图片
 */
//- (void)uploadFileWithFileType:(NSString *)fileType
//                           img:(UIImage *)selectImg
//                       fileUrl:(NSURL *)fileUrl
//                       success:(void (^)(id _Nonnull))successBlock
//                       failure:(void (^)(NSError * _Nonnull))failureBlock {
//    [self upLoadImgWithPath:<#(nonnull NSString *)#> img:<#(nonnull UIImage *)#> success:<#^(id  _Nonnull responseObject)successBlock#> failure:<#^(NSError * _Nonnull error)failureBlock#>]
//}

@end
